package com.ynny.chapter14.service.imp;

import com.ynny.chapter14.mapper.StudentMapper;
import com.ynny.chapter14.pojo.Student;
import com.ynny.chapter14.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;
    @Override
    public List<Student> login(Student student) {
        List<Student> login = studentMapper.login(student);
        return login;
    }

    @Override
    public List<Student> findAll() {
        List<Student> all = studentMapper.findAll();
        return all;
    }

    @Override
    public int add(Student student) {
        int i = studentMapper.add(student);
        return i;
    }

    @Override
    public int update(Student student) {
        int i = studentMapper.update(student);
        return i;
    }

    @Override
    public int delete(Integer id) {
        int i = studentMapper.delete(id);
        return i;
    }

    @Override
    public List<Student> findOne(Student student) {
        List<Student> one = studentMapper.findOne(student);
        return one;
    }
}
